package com.dyz.leetcode._08_StackAndQueue;

import java.util.ArrayDeque;

public class JavaStack {
    public static void main(String[] args) {
        //双端队列
        ArrayDeque<Integer> stack = new ArrayDeque<>();
        //插入顶部
        stack.push(1);
        stack.addFirst(2);
        stack.offerFirst(3);


        //插入底部
        stack.add(8);
        stack.addLast(5);
        stack.offer(4);
        stack.offerLast(6);

        //
        // 弹出顶
        stack.pop();
        stack.removeLast();
        stack.removeFirst();


        //查看
        stack.peek();
        stack.peekFirst();
        stack.removeLast();

        //判读是否为空
        stack.isEmpty();

        stack.size();


    }
}
